Run django-upgrade and linting on CI#2820
Conversation
| rev: 1.29.1 | ||
| hooks: | ||
| - id: django-upgrade | ||
| args: [--target-version=4.2] |
There was a problem hiding this comment.
The tool looks for the Django version in pyproject.toml. We don't have one, so defaults to 2.2. So let's specify it here, and remember to update when also bumping the Django version in base-requirements.txt.
https://django-upgrade.readthedocs.io/en/latest/options.html#cmdoption-target-version
There was a problem hiding this comment.
remember to update when also bumping
😬
| ci: | ||
| autoupdate_schedule: quarterly |
There was a problem hiding this comment.
In case we want to enable https://pre-commit.ci/ ? Be less spammy than the default weekly.
There was a problem hiding this comment.
pre-commit.ci would also replace your github action and run faster. It's quite optimized
There was a problem hiding this comment.
I think it's also useful to have it in GitHub Actions, to be able to already catch things in forks.
| rev: 1.29.1 | ||
| hooks: | ||
| - id: django-upgrade | ||
| args: [--target-version=4.2] |
There was a problem hiding this comment.
remember to update when also bumping
😬
Description
django-upgrade upgrades Django code, which can help update deprecations to make upgrading to the next LTS easier.
Also add it to
.pre-commit-config.yamlwith some other linters, and run it on GitHub Actions.We can also add things like Ruff formatting/linting to
.pre-commit-config.yamllater: #2540